import type { RouteRecordRaw } from 'vue-router';
import { PUBLIC_PATH } from '@/config/public-path';
import { RouterName } from '@/config/router';
import TheRoot from '@/components/the-root.vue';

export const routes = Object.freeze<RouteRecordRaw[]>([
  {
    path: PUBLIC_PATH,
    name: RouterName.Root,
    component: TheRoot,
    children: [
      {
        path: '',
        redirect: '/characters',
      },
      {
        path: 'home',
        name: RouterName.Home,
        component: () => import('@/views/page-home'),
      },
      {
        path: 'characters',
        name: RouterName.CharacterList,
        component: () => import('@/views/roleplay/character-list.vue'),
      },
      {
        path: 'characters/create',
        name: RouterName.CharacterCreate,
        component: () => import('@/views/roleplay/character-create.vue'),
      },
      {
        path: 'characters/manage',
        name: RouterName.CharacterManage,
        component: () => import('@/views/roleplay/character-manage.vue'),
      },
      {
        path: 'chat/:characterId/:conversationId?',
        name: RouterName.Chat,
        component: () => import('@/views/roleplay/chat.vue'),
        props: true,
      },
    ],
  },

  {
    path: '/test',
    name: RouterName.Forbidden,
    component: () => import('@/views/page-test.vue'),
  },
]);
